package com.ethan.springcloud.helloservice.feign.controller;

import com.ethan.springclod.api.api.HelloServiceApi;
import com.ethan.springclod.api.vo.User;
import com.ethan.springcloud.helloservice.feign.service.HelloService;
import com.ethan.springcloud.helloservice.feign.service.RefactHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author daifei
 * @date 2019/7/19
 */
@RestController
public class Controller {


//    @Autowired
//    private HelloService helloService;

    @Autowired
    private RefactHelloService helloServiceApi;

    @GetMapping("feign-hello")
    private String test(@RequestParam String name){
        return  helloServiceApi.hello1(name);
    }


    @GetMapping("feign-hello3")
    private String test3(){
        User user = new User();
        user.setName("ethan");
        user.setAge(28);
        return  helloServiceApi.hello2(user);
    }

}
